<template>
  <div>
     <div class="title">热销推荐</div>
     <!-- 景点例子-->
     <ul>
    <!-- 点击跳转详情页-->
     <!-- border-bottom 为1像素边框解决方案 tag=li 是将router-link转变为li-->
       <!-- :to 通过url进行传参 -->
       <router-link tag="li"
       class="item border-bottom" v-for="(item, index) in list"
       :key="index" :to="'/detail/' + item.id">
       <!-- 图片-->
           <img class="item-img" :src="item.imgUrl">
       <!-- 右边的介绍区-->
         <div class="item-info">
           <p class="item-title">{{item.title}}</p>
           <p class="item-desc">{{item.desc}}</p>
           <button class="item-button">  查看详情  </button>
         </div>
       </router-link >
     </ul>
     <p class='all-select border-bottom'> 查看所有产品 </p>
  </div>
</template>

<script>
export default {
  name: 'HomeRecommend',
  props: {
    list: Array
  }
}
</script>

<style lang="stylus" scoped>
  @import '~stylus/varibles.styl'
  @import '~stylus/mixins.styl'
  .title
    margin-top: .2rem
    line-height: .8rem
    background: #eee
    text-indent: .2rem
  .all-select
    height: .60rem
    // margin: .30rem auto;
    line-height: .60rem
    text-align: center
    color: $bgColor
    font-size: .25rem
  .item
    overflow: hidden
    height: 1.9rem
    display: flex
    margin-top: .1rem
    margin-bottom: .2rem
    .item-img
      padding: .1rem
      width: 1.7rem
      height: 1.7rem
    .item-info
      flex: 1
      padding: .2rem
      min-width: 0
      .item-title
        ling-height: .54rem
        font-size: .32rem
        ellipsis()
      .item-desc
        margin-top: .10rem
        line-height: .4rem
        color: #ccc
        ellipsis()
      .item-button
        line-height: .44rem
        margin-top: .33rem
        background: #ff8c12
        padding: 0 .2rem
        border-radius: .06rem
        color: #fff
        font-size: .16rem
</style>
